home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol178 / runme.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1986-11-25  |  28.3 KB  |  413 lines

  1. 100  KEY OFF:SCREEN 0:WIDTH 80:COLOR 14,1,1:CLS
  2. 101  LOCATE 10,1:PRINT"Choose the device:"
  3. 102  PRINT"     1: monitor"
  4. 103  PRINT"     2: printer"
  5. 104  INPUT"",A$
  6. 105  IF A$="1" THEN DEVICE$="con" ELSE IF A$="2" THEN DEVICE$="prn" ELSE 100
  7. 106  CLS
  8. 107  OPEN DEVICE$ FOR OUTPUT AS #1:GOSUB 503
  9. 108  GOSUB 110 : CLOSE
  10. 109  END
  11. 110  PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,""
  12. 111  PRINT #1,"========== Introduction ================":PRINT #1,"":PRINT #1,""
  13. 112  PRINT #1,"  I had three objectives while writing this program:"
  14. 113  PRINT #1,"a) to introduce an IBM PC to my 5.5 year old son in an easy way,"
  15. 114  PRINT #1,"b) to make learning reading and writing more fun for him,"
  16. 115  PRINT #1,"c) to have him profitably employed for short times during weekends."
  17. 116  PRINT #1,"  Since he has been first shown the program he learnt to read and"
  18. 117  PRINT #1,"write quite decently. Though I can't ascribe his progress solely to the"
  19. 118  PRINT #1,"availability of the program or any other software, he has learnt much"
  20. 119  PRINT #1,"using it. A good indication to this is that the words he learnt through"
  21. 120  PRINT #1,"the program he recognizes much faster and with less effort than any other."
  22. 121  PRINT #1,"He also spends more time with the computer than I have expected, knows to"
  23. 122  PRINT #1,"write short programs, i.e. drawing squares, is not unaware of the existence"
  24. 123  PRINT #1,"of variables, and has a general understanding that a computer is a machine"
  25. 124  PRINT #1,"that is made to obey human commands, while a human is to learn the commands"
  26. 125  PRINT #1,"a computer is capable to understand.
  27. 126  PRINT #1," Perhaps the program resembles the well-known turtle graphics, though"
  28. 127  PRINT #1,"it is much simpler and supports just few features of a programming language."
  29. 128  PRINT #1,"On the other hand, it is probably easier to use and more intertaining for"
  30. 129  PRINT #1,"younger children.":GOSUB 503
  31. 130  PRINT #1,"  The program consists of directories upon entering which a menu is displayed"
  32. 131  PRINT #1,"showing what kind of commands are acceptable in a particular directory."
  33. 132  PRINT #1,"All other commands will be ignored without any harm. The program lets one"
  34. 133  PRINT #1,"draw, paint, sketch etc. in IBM PC medium graphic resolution, though I for one"
  35. 134  PRINT #1,"do not conceive it as a drawing tool. It allows also writing programs or rather macros, to automate drawing procedure and to simplify it. The command names"
  36. 135  PRINT #1,"are to be written in full. However they can be shorthanded by writing macros."
  37. 136  PRINT #1,"This will be explained shortly. Thus unless a child acquired some knowledge"
  38. 137  PRINT #1,"of the program he is forced to type full words which makes him to memorize"
  39. 138  PRINT #1,"them."
  40. 139  PRINT #1,"  The names I used to identify the commands are to a great extent arbitrary."
  41. 140  PRINT #1,"And I am not at all sure that I chose the most suitable. In this respect I"
  42. 141  PRINT #1,"counted on implicit hints from my son. However he conceives the program as a"
  43. 142  PRINT #1,"part of the computer without crediting me with writing it. And as a consequence"
  44. 143  PRINT #1,"of his attitude I was unable to elicit from him the more appropriate wording."
  45. 144  PRINT #1,"Giving a command means typing it and pressing Enter key. Each command normally":PRINT #1,"consists of a single word with the exception of a few in the draw, change"
  46. 145  PRINT #1,"picture, and program directories which can consist of two words."
  47. 146  PRINT #1,"Next I shall describe commands available in each directory.":GOSUB 503
  48. 147  PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,""
  49. 148  PRINT #1,"=================== The main menu ===================="
  50. 149  PRINT #1,"":PRINT #1,"":PRINT #1,""
  51. 150  PRINT #1,"draw    - points to the directory where all essential drawing is supposed to be":PRINT #1,"          done."
  52. 151  PRINT #1,"paint   - directory responsible for color manipulation"
  53. 152  PRINT #1,"change  - comprises usefull commands that could not be appropriately placed in":PRINT #1,"          other directories"
  54. 153  PRINT #1,"picture - responsible for picture displaying, storing, retrieving, etc."
  55. 154  PRINT #1,"type    - adds text to a drawing"
  56. 155  PRINT #1,"program - lets writing, modifying, storing ...programs"
  57. 156  PRINT #1,"clock   - a clock game"
  58. 157  PRINT #1,"week    - a weekdays game"
  59. 158  PRINT #1,"exit    - ends the session":GOSUB 501
  60. 159  PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,""
  61. 160  PRINT #1,"==================== The draw menu =================="
  62. 161  PRINT #1,"":PRINT #1,""
  63. 162  PRINT #1,"left    - turns arrow left and then steps one step forward"
  64. 163  PRINT #1,"right   - turns arrow right and then steps one step forward"
  65. 164  PRINT #1,"ahead   - one step forward"
  66. 165  PRINT #1,"back    - turns arrow back and steps one step forward"
  67. 166  PRINT #1,"turn    - turns arrow through 45 degrees counterclockwise and steps one step":PRINT #1,"          forward"
  68. 167  PRINT #1,"up      - when up is on the arrow moves without drawing, up is in reverse video":PRINT #1,"          in the menu. Does not effect line or circle commands."
  69. 168  PRINT #1,"down    - when down is on the arrow draws while moving, draw is in reverse":PRINT #1,"          in the menu. Does not effect line or circle commands."
  70. 169  PRINT #1,"center  - stores current arrow location as the center of future circles"
  71. 170  PRINT #1,"circle  - draws a circle with a stored center through the current arrow location"
  72. 171  PRINT #1,"line    - stores current arrow location as a first endpoint of a line"
  73. 172  PRINT #1,"end     - draws a line between the stored and current arrow locations"
  74. 173  PRINT #1,"erase   - makes arrow to draw in the background color while moving thus":PRINT #1,"          effectively erasing whatever it passes over":GOSUB 503
  75. 174  PRINT #1,"box     - used as a first step in sprite generation. Stores a corner of":PRINT #1,"          a rectangle"
  76. 175  PRINT #1,"fix     - uses the current arrow position as the opposite corner of a":PRINT #1,"          rectangular sprite. Makes the content of the rectangle a sprite."
  77. 176  PRINT #1,"put     - puts a sprite with its upper left corner at the current arrow":PRINT #1,"          position. Uses XOR option of the PC BASIC put command"
  78. 177  PRINT #1,"sprite  - go to the sprite directory"
  79. 178  PRINT #1,"program - go to the program directory"
  80. 179  PRINT #1,"var     - display the current content of the ten elligible variables:":PRINT #1,"          var0, var1, ..., var8, var9. Press Enter key to remove the display"
  81. 180  PRINT #1,"var#=   - defines an assignment statement which must be in one of the forms:"
  82. 181  PRINT #1,"          var0=3 or var7=-20"
  83. 182  PRINT #1,"          var4=var2-var1 or var8=var2*5
  84. 183  PRINT #1,"          in other words a variable can be assigned a value given explicitly":PRINT #1,"          or stored in another variable or computed as a result of a simple"
  85. 184  PRINT #1,"          arithmetic axpressions consisting of two opperands each of which"
  86. 185  PRINT #1,"          must be an elligible variable or a constant number"
  87. 186  PRINT #1,"status  - displays current values of some parameters like step, colors and etc":PRINT #1,"          Use space bar to cycle through the display and Enter key to":PRINT #1,"          remove it"
  88. 187  PRINT #1,"quit    - returns to main menu":GOSUB 503
  89. 188  PRINT #1,"":PRINT #1,"Remark:"
  90. 189  PRINT #1,"        Commands left,right,turn,ahead,back can be given as two word"
  91. 190  PRINT #1,"        commands, the second word being either a var#, where # changes from"
  92. 191  PRINT #1,"        0 through 9, or just a constant number. The command will then be"
  93. 192  PRINT #1,"        executed the corresponding number of times."
  94. 193  PRINT #1,"        For example,"
  95. 194  PRINT #1,"                      left 4"
  96. 195  PRINT #1,"        draws a square whose side is equal to the current step and returns"
  97. 196  PRINT #1,"        arrow to the original position. The same applies to all macros, i.e."
  98. 197  PRINT #1,"        if pr is a program, then typing in "
  99. 198  PRINT #1,"                      pr var7"
  100. 199  PRINT #1,"        will result in the macro pr being executed the number of times equal to"
  101. 200  PRINT #1,"        the content of var7. If var7=0 nothing will happen. On the other hand,"
  102. 201  PRINT #1,"                      pr"
  103. 202  PRINT #1,"        is equivalent to typing"
  104. 203  PRINT #1,"                      pr 1"
  105. 204  PRINT #1,"        There must be a blank between two words. If the second word is a "
  106. 205  PRINT #1,"        var# then there must be only one blank. Number of blanks can be"
  107. 206  PRINT #1,"        arbitrary if the second word is just a constant number.":GOSUB 503
  108. 207  PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,""
  109. 208  PRINT #1,"=============== The paint menu ============================
  110. 209  PRINT #1,""
  111. 210  PRINT #1,"ground  - go to choose the background color"
  112. 211  PRINT #1,"fill    - go to choose between filling regions with color or with a pattern."
  113. 212  PRINT #1,"          In either case filling starts at the current arrow position."
  114. 213  PRINT #1,"          The boundary of a region should be in the current drawing color."
  115. 214  PRINT #1,"          Otherwise the paint may split over the intended boundary."
  116. 215  PRINT #1,"arrow   - choose a palette and a drawing color"
  117. 216  PRINT #1,"program - has the same meaning as that in the draw directory. The same holds"
  118. 217  PRINT #1,"          for all other directories where the command 'program' appears."
  119. 218  PRINT #1,"quit    - returns to the main menu":GOSUB 503
  120. 219  PRINT #1,"":PRINT #1,""
  121. 220  PRINT #1,"============ The change menu ================
  122. 221  PRINT #1,"":PRINT #1,""
  123. 222  PRINT #1,"new     - lets you start from the beginning. The entire screen is lost.":PRINT #1,"          The content of a box (sprite) is still avalable though."
  124. 223  PRINT #1,"wide    - widens the arrow size by two pixels. The effective drawing surface"
  125. 224  PRINT #1,"          can be 1, 3, or 5 pixels wide. If it is 5 pixels wide the 'wide'"
  126. 225  PRINT #1,"          command has no effect."
  127. 226  PRINT #1,"narrow  - reduces the drawing surface of the arrow by two pixels. Opposite to"
  128. 227  PRINT #1,"          wide. Has no effect if the drawing surface is 1 pixel wide.
  129. 228  PRINT #1,"step n  - changes step to n pixels, i.e. the arrow when asked to move will"
  130. 229  PRINT #1,"          skip over n pixels then stop. This is equivalent to saying that"
  131. 230  PRINT #1,"          the arrow may move only from one vertex of the square lattice of"
  132. 231  PRINT #1,"          size n, to another."
  133. 232  PRINT #1,"visible - a toggle switch. Changes visibility of the arrow. Visible becomes"
  134. 233  PRINT #1,"          invisible and vice versa.":GOSUB 503
  135. 234  PRINT #1,"undo    - returns the content of the screen as it was when the command 'screen'"
  136. 235  PRINT #1,"          from the picture directory was last invoked."
  137. 236  PRINT #1,"eastwest- changes the part of the screen drawing takes place in. A drawing"
  138. 237  PRINT #1,"          is created on a screen 320 pixels wide. However at any time one can"
  139. 238  PRINT #1,"          see and draw only over one of two portions of the screen, eastern or"
  140. 239  PRINT #1,"          western parts of the screen. Thus the 'eastwest' command is used to"
  141. 240  PRINT #1,"          swap working and idle parts of the screen. The information as to"
  142. 241  PRINT #1,"          what part of the screen is currently being drawn upon is available"
  143. 242  PRINT #1,"          through the 'status' command in the draw directory."
  144. 243  PRINT #1,"net     - a toggle switch. Displays or removes a square net of 3 step sizes."
  145. 244  PRINT #1,"          Very convenient for counting the number of steps required to get to"
  146. 245  PRINT #1,"          a desired location. Should not be visible when one actually draws."
  147. 246  PRINT #1,"program - as usual"
  148. 247  PRINT #1,"tall    - increases the vertical size of a circle"
  149. 248  PRINT #1,"flat    - increases the horizontal size of a circle. Thus through 'tall' and"
  150. 249  PRINT #1,"          'flat' commands a circle can be made into an ellipse arbitrary tall"
  151. 250  PRINT #1,"          or arbitrary flat. The two commands cancel each other effect indeed."
  152. 251  PRINT #1,"quit    - returns to main menu"
  153. 252  PRINT #1,"":PRINT #1,"Remark:"
  154. 253  PRINT #1,"   The Remark in Draw directory applies to commands wide,narrow,tall, and flat.":GOSUB 503
  155. 254  PRINT #1,"":PRINT #1,"":PRINT #1,""
  156. 255  PRINT #1,"============ The type directory ===============================
  157. 256  PRINT #1,""
  158. 257  PRINT #1,"  Adds text to a drawing. Cursor is controled by all eight cursor keys. Editing is only by means of the cursor keys and the space bar."
  159. 258  PRINT #1,"  To leave the directory press Enter key. "
  160. 259  PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,"":GOSUB 503
  161. 260  PRINT #1,"============ The picture menu ============================
  162. 261  PRINT #1,""
  163. 262  PRINT #1,"save    - save a picture to a disk. If the name was not defined via 'name'"
  164. 263  PRINT #1,"          command the computer will inquire about the name.":         PRINT #1,"          It always gives the extention .PIC to the file name."
  165. 264  PRINT #1,"load    - loads a picture from a disk. The current content of the video"
  166. 265  PRINT #1,"          memory is replaced and thus lost. The computer inquires about the"
  167. 266  PRINT #1,"          name of a file a picture is stored on if the name was not defined"
  168. 267  PRINT #1,"          via 'name' command."
  169. 268  PRINT #1,"name    - gives name to the current content of the screen. Should include"
  170. 269  PRINT #1,"          drive specification, if this is different from the default."
  171. 270  PRINT #1,"screen  - displays the entire screen. Its copy is automatically stored in an"
  172. 271  PRINT #1,"          array. This can be used in conjunction with 'undo' command from the"
  173. 272  PRINT #1,"          change directory. Before performing a risky operation like filling,"
  174. 273  PRINT #1,"          have a look at your creation through the 'screen' command to make"
  175. 274  PRINT #1,"          sure you'll see it again."
  176. 275  PRINT #1,"program - as usual
  177. 276  PRINT #1,"print   - dumps out the screen. I acknowledge a hint for dumping the screen"
  178. 277  PRINT #1,"          I found in the October 1985 issue of PC MAGAZINE. Do not forget":PRINT #1,"          to give GRAPHICS.COM command before running the program.":PRINT #1,"          Best of all create an AUTOEXEC.BAT file to do this"
  179. 278  PRINT #1,"frame   - the final version of the picture can appear with or without a frame."
  180. 279  PRINT #1,"          'frame' is a toggle switch. When the frame is attached the word"
  181. 280  PRINT #1,"          frame in the menu appears in reverse video."
  182. 281  PRINT #1,"files   - models the BASIC FILES command. Use files,or files b."
  183. 282  PRINT #1,"quit    - returns to the main menu"
  184. 283  PRINT #1,"":PRINT #1,""
  185. 284  PRINT #1,"================= The program menu =========================
  186. 285  PRINT #1,""
  187. 286  PRINT #1,"create  - lets one write a macro. Separate differnt commands with a comma."
  188. 287  PRINT #1,"          This apart, all commands are typed exactly the way they are typed in"
  189. 288  PRINT #1,"          in the immediate mode. Press Enter key only once: when the program"
  190. 289  PRINT #1,"          has been successfully or unsuccessfully typed in. Pressing Enter"
  191. 290  PRINT #1,"          key terminates the 'create' mode. If necessary you will be able to"
  192. 291  PRINT #1,"          modify your macro later with the 'modify' command.
  193. 292  PRINT #1,"delete  - deletes a macro from the list of macros"
  194. 293  PRINT #1,"modify  - edits macros using Ins and Del keys. Move the cursor using the"
  195. 294  PRINT #1,"          cursor keys. If your macro is too long to be displayed on a single"
  196. 295  PRINT #1,"          line move the cursor to the rightmost position and watch as the macro"
  197. 296  PRINT #1,"          slides to the left till you find the portion of it you want to"
  198. 297  PRINT #1,"          modify"
  199. 298  PRINT #1,"list    - lists all available macros. Maximum number of macros is 120"
  200. 299  PRINT #1,"display - displays a macro. Use the space bar to cycle through a macro that"
  201. 300  PRINT #1,"          is more than 39 characters long. Commas included."
  202. 301  PRINT #1,"rename  - renames a macro."
  203. 302  PRINT #1,"store   - stores all available macros to a file DATA.SUB. The existing file"
  204. 303  PRINT #1,"          with the same name is destroyed."
  205. 304  PRINT #1,"append  - appends currently used macros to a file DATA.SUB if the latter"
  206. 305  PRINT #1,"          exists. Otherwise acts as the 'store' command."
  207. 306  PRINT #1,"get     - retrieves the content of the file DATA.SUB"
  208. 307  PRINT #1,"key     - lets one to redefine the ten function keys"
  209. 308  PRINT #1,"quit    - returns to the directory from which 'program' was envoked":GOSUB 503
  210. 309  PRINT #1,""
  211. 310  PRINT #1,"Remark:"
  212. 311  PRINT #1,"        All commands in this directory communicate with the user. One must"
  213. 312  PRINT #1,"        carefully answer questions when asked. To exit a command press Enter."
  214. 313  PRINT #1,"        For reasons that will become clear later (sect. General remarks and"
  215. 314  PRINT #1,"        examples) it is unwise though to redefine F10."
  216. 315  PRINT #1,"        It is possible to effect two-word commands, e.g."
  217. 316  PRINT #1,"          modify pr, or   delete pr, or   display pr, etc."
  218. 317  PRINT #1,"":NLINES=4:GOSUB 503:NLINES=0
  219. 318  PRINT #1,"============== The sprite menu =========================
  220. 319  PRINT #1,""
  221. 320  PRINT #1,"move    - moves a sprite. A sprite must be prepared in the draw directory by"
  222. 321  PRINT #1,"          means of the box-fix sequence. An attempt to move an empty box will"
  223. 322  PRINT #1,"          result in an error message. 'move' is analogue to being up in the "
  224. 323  PRINT #1,"          draw directory: sprite moves without leaving a trace."
  225. 324  PRINT #1,"reverse - a toggle switch. Changes sprite to reverse video and back"
  226. 325  PRINT #1,"ns-flip - turns sprite around its x-axis: north-to-south"
  227. 326  PRINT #1,"ew-flip - turns sprite around its y-axis: east-to-west"
  228. 327  PRINT #1,"track   - after each step the sprite is XOR-PUT, often creates amusing designs"
  229. 328  PRINT #1,"3d      - after each step the sprite is pset-PUT, which creates a 3D-effect"
  230. 329  PRINT #1,"start   - if one wants to change from one of modes (move, track, 3d) to another"
  231. 330  PRINT #1,"          he/she needs just to type in the desired mode. But being already in"
  232. 331  PRINT #1,"          in one of modes in order to activate it one needs to type in 'start'"
  233. 332  PRINT #1,"rotate  - if sprite is square, rotates it through 90 degrees counterclockwise,
  234. 333  PRINT #1,"          otherwise produces an error message"
  235. 334  PRINT #1,"rubber  - replaces temporarily sprite by a blank square with visible boundary"
  236. 335  PRINT #1,"          to which all of the above applies. In 3d and track modes has the"
  237. 336  PRINT #1,"          effect of erasing anything it passes over. In the move mode has no"
  238. 337  PRINT #1,"          effect at all"
  239. 338  PRINT #1,"quit    - returns to the draw directory"
  240. 339  PRINT #1,"":PRINT #1,"":GOSUB 503
  241. 340  PRINT #1,"Remark:"
  242. 341  PRINT #1,"       When one of modes is activated sprite is controled by eight cursor keys."
  243. 342  PRINT #1,"       Its step and therefore speed is controled by '+' and '-' keys. Speed"
  244. 343  PRINT #1,"       can not be negative. If it is 0 sprite would not move. To make it move"
  245. 344  PRINT #1,"       press '+' which will make speed positive"
  246. 345  PRINT #1,"       There is only one box to store a sprite. Using 'rubber' is rather an"
  247. 346  PRINT #1,"       exception. The best way to save sprites is to organize a picture that"
  248. 347  PRINT #1,"       contains many of them. Then each time a particular sprite is needed"
  249. 348  PRINT #1,"       the current picture must be stored on disk, the one with sprites must"
  250. 349  PRINT #1,"       be loaded. After the desired sprite has been put into box swap the "
  251. 350  PRINT #1,"       pictures back.":GOSUB 503
  252. 351  PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,""
  253. 352  PRINT #1,"======= Ground, fill, arrow menus ======================
  254. 353  PRINT #1,"":PRINT #1,""
  255. 354  PRINT #1,"  Via 'ground' command one can change the background color. All possible colors"
  256. 355  PRINT #1,"are displayed by a menu. The option 'bright' makes the current background"
  257. 356  PRINT #1,"brighter. To change color type in the desired background, press Enter, type"
  258. 357  PRINT #1,"'go' and press Enter again."
  259. 358  PRINT #1,"  Fill has two options: color and design. With 'color' the procedure is the"
  260. 359  PRINT #1,"same as before, i.e. through a 'go'. In 'design' typing the design number and"
  261. 360  PRINT #1,"pressing Enter will do."
  262. 361  PRINT #1,"  Via 'arrow' one changes both palettes and drawing colors. Here instead of"
  263. 362  PRINT #1,"words one types in numbers: 0-1 for palettes, 0-3 for drawing color. Again 'go'"
  264. 363  PRINT #1,"replaces 'quit'.":NLINES=5:GOSUB 503:NLINES=0
  265. 364  PRINT #1,"":PRINT #1,"":PRINT #1,"":PRINT #1,""
  266. 365  PRINT #1,"========== General remarks and examples ==================
  267. 366  PRINT #1,"":PRINT #1,"":PRINT #1,""
  268. 367  PRINT #1,"  1) Drawing apart, using macros facilitates moving between directories."
  269. 368  PRINT #1,"For example, to get from the draw directory to the design directory one has"
  270. 369  PRINT #1,"to type in consecutively the following:"
  271. 370  PRINT #1,"     a) quit     - gets one to the main menu (press Enter)"
  272. 371  PRINT #1,"     b) paint    - gets one inside the paint directory"
  273. 372  PRINT #1,"     c) fill     - lets one to choose between color and design fill"
  274. 373  PRINT #1,"     d) design"
  275. 374  PRINT #1,"  In the design directory one picks say the design #12 by typing 12 and"
  276. 375  PRINT #1,"pressing Enter. To get back to the draw directory one must type in one after"
  277. 376  PRINT #1,"another the following: "
  278. 377  PRINT #1,"     a) quit     - gets one to paint menu"
  279. 378  PRINT #1,"     b) quit     - gets one to the main menu"
  280. 379  PRINT #1,"     c) draw     - lets one into the draw directory"
  281. 380  PRINT #1,"  This all can be combined into two macros: dr-ds(draw-design) and ds-dr"
  282. 381  PRINT #1,"(design-draw). Enter the program directory, type 'create' and press Enter."
  283. 382  PRINT #1,"In the right lower corner of the screen will appear message NAME IT, thus"
  284. 383  PRINT #1,"type just this: quit,paint,fill,design. Press Enter. The dr-ds macro has been"
  285. 384  PRINT #1,"created. In a similar fashion, you create the ds-dr program. Now the task of"
  286. 385  PRINT #1,"choosing design while you are in the draw directory could be accomplished"
  287. 386  PRINT #1,"by first typing in 'dr-ds' and pressing Enter, then after getting to the"
  288. 387  PRINT #1,"design directory you type in the desired number, press Enter, type in 'ds-dr',"
  289. 388  PRINT #1,"press Enter and you are back in the draw directory."
  290. 389  GOSUB 503
  291. 390  PRINT #1,"  Anyone with experience in BASIC will realize that the macro 'ds-dr' is just"
  292. 391  PRINT #1,"a string ds-dr$="+CHR$(34)+"quit,quit,draw"+CHR$(34)+" commas included, blanks are not permitted."
  293. 392  PRINT #1,"  The above procedure can further be simplified by using variables. For "
  294. 393  PRINT #1,"example, create a macro des.fill: dr-ds,var0,ds-dr. While in the draw directory"
  295. 394  PRINT #1,"type in "
  296. 395  PRINT #1,"        var0=12
  297. 396  PRINT #1,"and press Enter, then type des.fill. The result is the same as before. "
  298. 397  GOSUB 503
  299. 398  PRINT #1," 2) This is a drawing example. Write a macro step3:"
  300. 399  PRINT #1,"      quit,change,step var3,quit,draw"
  301. 400  PRINT #1,"Set var3=1 by typing in this equation and pressing Enter. Next type step3 and "
  302. 401  PRINT #1,"again press Enter. Wait till the command has been carried out. See that the"
  303. 402  PRINT #1,"arrow is down. Type
  304. 403  PRINT #1,"   box (Enter), left 3 (Enter), back (Enter), fix (Enter)
  305. 404  PRINT #1,"You now have a 2x2 colored box as a sprite. Go to the sprite directory. When"
  306. 405  PRINT #1,"you come their you will be in the move mode. To move the sprite type in"
  307. 406  PRINT #1,"      start (Enter)"
  308. 407  PRINT #1,"This gives you access to cursor control through the cursor keys. Press Enter"
  309. 408  PRINT #1,"when you are ready to return to the sprite menu. Try now 3d mode. You draw "
  310. 409  PRINT #1,"with a 2x2 brush. It is difficult to appreciate the difference between 3d and"
  311. 410  PRINT #1,"track modes with a 2x2 sprite. Go to the draw menu to pick a bigger sprite, "
  312. 411  PRINT #1,"then return to experiment with different sprite modes."
  313. 412  PRINT #1," Three files are supplied with the program: DESIGNS.PIC,SQUARES.PIC, FACE.PIC. "
  314. 413  PRINT #1,"Enter program, go to the picture directory, load them. Both contain useful tips"
  315. 414  PRINT #1,"on how to better exploit some features of the program."
  316. 415  NLINES=8:GOSUB 503:NLINES=0
  317. 416  PRINT #1," 3) This is a painting example. The program should be distributed with a few"
  318. 417  PRINT #1,"additional files. Thus it is hoped you have a file SPIRAL1.PIC on a diskette."
  319. 418  PRINT #1,"From the main menu go to the picture directory. Type
  320. 419  PRINT #1,"             load (Enter)"
  321. 420  PRINT #1,"A prompt NAME? will be displayed in the lower right corner. Type  spiral1"
  322. 421  PRINT #1,"and press Enter. In a while a picture appears that should resemble a spiral."
  323. 422  PRINT #1,"Return to the main menu, and from here to draw. See that the arrow is up and"
  324. 423  PRINT #1,"move it outside the spiral. Go now to the fill menu and choose the color"
  325. 424  PRINT #1,"option. Choose a color, type 'go' and watch. The picture SPIRAL.PIC was drawn"
  326. 425  PRINT #1,"using spiral command from the DATA.SUB file. It is a classical example from the"
  327. 426  PRINT #1,"turtle graphics. To draw such picture one has to set var0=8 and var1=8 before"
  328. 427  PRINT #1,"giving the command"
  329. 428  PRINT #1,"               spiral 20"
  330. 429  PRINT #1,"It takes a while to draw a spiral. But to draw the same picture you will need"
  331. 430  PRINT #1,"two of them a little shifted with respect to one another."
  332. 431  GOSUB 503
  333. 432  PRINT #1," 4) A few things should be remembered. The most essential is that when in"
  334. 433  PRINT #1,"doubt as to what to do one should press Enter. This at least will do no harm,"
  335. 434  PRINT #1,"but may prove helpful."
  336. 435  PRINT #1,"  Secondly, if by some chance you made a recursive call in such a manner that"
  337. 436  PRINT #1,"a program entered an infinite loop calling repeatedly itself, press F10 key."
  338. 437  PRINT #1,"This is why it is unadvisible to redefine it."
  339. 438  PRINT #1,"  Thirdly, one must carefully combine drawing and background colors. "
  340. 439  PRINT #1,"In graphics mode IBM PC types using the third color from a current palette."
  341. 440  PRINT #1,"This is either white (palette 1) or brown (palette 0). Thus choosing a color"
  342. 441  PRINT #1,"for background close to one of the above may have an adverse effect on the"
  343. 442  PRINT #1,"quality of the display since all menus are just typed each time they are "
  344. 443  PRINT #1,"needed."
  345. 444  PRINT #1,"  Fourthly, once I realized that in principal, recursive calls are handled"
  346. 445  PRINT #1,"properly by the program (something I have not intended at the outset), I felt"
  347. 446  PRINT #1,"it would be pity not to supply means of using recursive calls meaningfully."
  348. 447  PRINT #1,"Therefore I added to the draw menu a command which is mentioned nowhere else."
  349. 448  PRINT #1,"This is "
  350. 449  PRINT #1,"          if.neg var#"
  351. 450  PRINT #1,"which constitutes a logical expression true if and only if var#<0. If var#<0 "
  352. 451  PRINT #1,"then appearence of the above command causes the subprogram being executed to"
  353. 452  PRINT #1,"terminated. The macro 'stairs' along with a recursive subprogram 'cc' serve"
  354. 453  PRINT #1,"as an example that employs the if.neg command. Both should be found on the"
  355. 454  PRINT #1,"original diskette."
  356. 455  NLINES=15:GOSUB 503:NLINES=0
  357. 456  PRINT #1,"":PRINT #1,""
  358. 457  PRINT #1," =========== The clock and the week ====="
  359. 458  PRINT #1,"":PRINT #1,""
  360. 459  PRINT #1," The only relevance these games have to the program is that I used it to draw"
  361. 460  PRINT #1,"the face of the clock. Also my son likes them very much. He mastered them in
  362. 461  PRINT #1,"a very short time indeed. "
  363. 462  PRINT #1,"  Pressing '+' or '-' you can make it run faster or slower. To make a guess"
  364. 463  PRINT #1,"press Enter key, to quit press the space bar. The levels differ in a simple "
  365. 464  PRINT #1,"way: level 5 requires exact time, level 4 accepts the time with the error +-1,"
  366. 465  PRINT #1,"the level 3 accepts +-2 min errors, level 2 +-3min, level 1 needs only 'hour"
  367. 466  PRINT #1,"response' without minutes. The week game has level 10."
  368. 467  PRINT #1,"  The file CLOCK.PIC is an integral part of the program."
  369. 468  GOSUB 503:PRINT #1,"":PRINT #1,""
  370. 469  PRINT #1," ========== Final note =============="
  371. 470  PRINT #1,"":PRINT #1,""
  372. 471  PRINT #1,"  I am very curious of the reaction children may have on this program."
  373. 472  PRINT #1,"It is unlikely that children under 8 would effectively use all features it "
  374. 473  PRINT #1,"provides. Still drawing simple shapes, putting them into a box, and using"
  375. 474  PRINT #1,"sprite technics should be a fun for very young children, say 5-6. As the number"
  376. 475  PRINT #1,"of macros used simultaneously grows the program not fast anyway will slow down"
  377. 476  PRINT #1,"even more. "
  378. 477  PRINT #1,"  There was an additional reason not mentioned in the Introduction, why I"
  379. 478  PRINT #1,"undertook writing this program. Actually it is my first BASIC program, and"
  380. 479  PRINT #1,"I wrote it as an exercise while studying BASIC. From the height of my present"
  381. 480  PRINT #1,"experience I see many ways to improve, simplify and speed up the program."
  382. 481  PRINT #1,"I do not have any personal incentive to do so. Thus I ask everybody who finds"
  383. 482  PRINT #1,"it worth his/her while to drop a note expressing his/her opinion and better yet"
  384. 483  PRINT #1,"experience in using this program. Please write to"
  385. 484  PRINT #1,""
  386. 485  PRINT #1,"             Alex Bogomolny"
  387. 486  PRINT #1,"             1802 W Benton St"
  388. 487  PRINT #1,"             Iowa City, IA 52240"
  389. 488  PRINT #1,""
  390. 489  PRINT #1,"  If there is a reasonable response to the program I promise to write a better"
  391. 490  PRINT #1,"one. A contribution of $10 will be wellcome as a manifestation of the "
  392. 491  PRINT #1,"program's usefulness and appreciation, but it is not requested. Please write"
  393. 492  PRINT #1,"if you have anything to remark on the program and children's reaction on it.":GOSUB 503
  394. 493  PRINT #1,"  For my son's sake I am going to add a game option to the main menu. What I"
  395. 494  PRINT #1,"have in mind is to incorporate simple arithmetic operations into the drawing"
  396. 495  PRINT #1,"process making at the same time use of macros compulsory. This should add to"
  397. 496  PRINT #1,"the educational value of the program. I hope to make this part funny. Anyone "
  398. 497  PRINT #1,"who contributes $10 will be notified when this modification is ready and will"
  399. 498  PRINT #1,"be supplied the new version for a nominal charge to cover a diskette cost plus"
  400. 499  PRINT #1,"postage. As I already said I will not modify the program proper unless there is"
  401. 500  PRINT #1,"more or less wide response to it."
  402. 501  GOSUB 503
  403. 502  RETURN
  404. 503  '
  405. 504  IF DEVICE$="con" THEN GOSUB 506 ELSE GOSUB 510
  406. 505  RETURN
  407. 506  PRINT #1,""
  408. 507  COLOR 7:LOCATE 25,20:PRINT" - press space bar to continue -";:COLOR 14
  409. 508  WHILE INKEY$<>" ":WEND:CLS:LOCATE 3,1
  410. 509  RETURN
  411. 510  FOR I=1 TO NLINES:LPRINT CHR$(10):NEXT I
  412. 511  RETURN
  413.